/*
 *  StrategyParameterSet005.h
 *  StrategyInspector
 *
 *  Created by jiro on 12/08/09.
 *  Copyright 2012 jiro music. All rights reserved.
 *
 */

#pragma once 

#include "StrategyParameterSet.h"
#include "StrategyDoubleParameter.h"
#include "StrategyDateParameter.h"
#include "StrategyStringParameter.h"
#include "DbTableEntry.h"
#include "FxBasicParameter.h"
#include "../DbTypes.h"

class StrategyParameterSet005 : public StrategyParameterSet 
{
public:

	enum ParamterId
	{
		Id_CurrencyCode,
		Id_TargetCurrencyCode,
		Id_Spread,
		Id_Charge,
		Id_TargetExchangeRateGap,
		Id_LossCutExchangeRateGap,
		Id_ShortTermMaLength,
		Id_MiddleTermMaLength,
		Id_TimeUnitSec,
		Id_StartDate,
		Id_EndDate,
		Id_Count
	};

public:

	static int parameterCount();
	static NSString* tableName();
	static NSString* queryCreateTable();
	static NSString* queryInsertInitialValues();
	static NSString* querySelectAll( const std::vector< ClauseNode >& clauses );
	static NSString* querySelect( const std::vector< FieldNode >& fieldNodes, const std::vector< ClauseNode >& clauses );

	StrategyParameterSet005( const StrategyParameterSet005& p );

	StrategyParameterSet005( const std::vector< const char* > values );

	StrategyParameterSet005(
		const FxBasicParameter& fxBasicParameter,
		const NSDate* startDate,
		const NSDate* endDate,
		const StrategyDoubleParameter& targetExchangeRateGap,
		const StrategyDoubleParameter& lossCutExchangeRateGap,
		const StrategyDoubleParameter& shortTermMaLength,
		const StrategyDoubleParameter& middleTermMaLength,
		const StrategyDoubleParameter& timeUnitSec
	);

	NSString* queryInsert() const;
	NSString* queryInsertValue() const;
	NSString* queryInsertWithSerialValue() const;
	NSString* queryInsertValueWithSerialValue() const;

	virtual ~StrategyParameterSet005();

	NSString* getCurrncyCode() const;
	NSString* getTargetCurrncyCode() const;
	double getSpread() const;
	double getCharge() const;
	double getTargetExchangeRateGap() const;
	double getLossCutExchangeRateGap() const;
	double getShortTermMaLength() const;
	double getMiddleTermMaLength() const;
	double getTimeUnitSec() const;
	NSDate* getStartDate() const;
	NSDate* getEndDate() const;

	void setCurrncyCode( NSString* code );
	void setTargetCurrncyCode( NSString* code );
	void setSpread( double spread );
	void setCharge( double charge );
	void setTargetExchangeRateGap( double delta );
	void setLossCutExchangeRateGap( double delta );
	void setShortTermMaLength( double length );
	void setMiddleTermMaLength( double length );
	void setTimeUnitSec( double unit );
	void setStartDate( NSDate* date );
	void setEndDate( NSDate*date );

};
